#!/usr/bin/python


import syslog;

import random; 

import time;


temperature = 20;


while(1):
    
	if 20<temperature<=25:
      
		syslog.openlog(ident="HeatSensor8",logoption=syslog.LOG_PID,facility=syslog.LOG_LOCAL0);
      
		syslog.syslog(syslog.LOG_INFO,'<info> Heat sensor is working correctly');
      
		syslog.closelog();
    
    
	elif 25<temperature<42:
      
		syslog.openlog(ident="HeatSensor8",logoption=syslog.LOG_PID,facility=syslog.LOG_LOCAL0);
      
		syslog.syslog(syslog.LOG_WARNING,'<warn> Check system!');
      
		syslog.closelog();
    
    
	elif 42<=temperature:
      
		syslog.openlog(ident="HeatSensor8",logoption=syslog.LOG_PID,facility=syslog.LOG_LOCAL0);
      
		syslog.syslog(syslog.LOG_ALERT,'<alert> High Temperature is detected!');
      
		syslog.closelog();
      
    
	time.sleep(2);
    
	temperature = temperature + 1;